home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 124 / cd-rom 124.iso / edu / tuxmath / tuxmathscrabble / tuxmathscrabble.exe / asymptopia / CuckooManeuvers.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2003-11-16  |  9.0 KB  |  665 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.2)
  3.  
  4. import os
  5. import pygame
  6. import sys
  7. from pygame.locals import *
  8. from random import random
  9. from Maneuvers import Maneuvers
  10. from asymptopia.myutil import *
  11.  
  12. try:
  13.     for sitepkgdir in sys.path:
  14.         if sitepkgdir[-13:] == 'site-packages':
  15.             break
  16.         
  17. except:
  18.     pass
  19.  
  20.  
  21. class CuckooManeuvers(Maneuvers):
  22.     
  23.     def __init__(self):
  24.         self.maneuvers = { }
  25.         img_cuckoo_flap_01 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_flap_01.gif'))
  26.         img_cuckoo_flap_02 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_flap_02.gif'))
  27.         cuckoo_flap = [
  28.             {
  29.                 'img': img_cuckoo_flap_02,
  30.                 'snd': None,
  31.                 'dx': 0,
  32.                 'dy': 0,
  33.                 'timeout': 0 },
  34.             {
  35.                 'img': img_cuckoo_flap_01,
  36.                 'snd': None,
  37.                 'dx': 0,
  38.                 'dy': -3,
  39.                 'timeout': 0 },
  40.             {
  41.                 'img': img_cuckoo_flap_01,
  42.                 'snd': None,
  43.                 'dx': 0,
  44.                 'dy': 0,
  45.                 'timeout': 0 },
  46.             {
  47.                 'img': img_cuckoo_flap_01,
  48.                 'snd': None,
  49.                 'dx': 0,
  50.                 'dy': 0,
  51.                 'timeout': 0 },
  52.             {
  53.                 'img': img_cuckoo_flap_01,
  54.                 'snd': None,
  55.                 'dx': 0,
  56.                 'dy': 0,
  57.                 'timeout': 0 },
  58.             {
  59.                 'img': img_cuckoo_flap_02,
  60.                 'snd': None,
  61.                 'dx': 0,
  62.                 'dy': 3,
  63.                 'timeout': 0 },
  64.             {
  65.                 'img': img_cuckoo_flap_02,
  66.                 'snd': None,
  67.                 'dx': 0,
  68.                 'dy': 0,
  69.                 'timeout': 0 },
  70.             {
  71.                 'img': img_cuckoo_flap_02,
  72.                 'snd': None,
  73.                 'dx': 0,
  74.                 'dy': 0,
  75.                 'timeout': 0 },
  76.             {
  77.                 'img': img_cuckoo_flap_02,
  78.                 'snd': None,
  79.                 'dx': 0,
  80.                 'dy': 0,
  81.                 'timeout': 0 },
  82.             {
  83.                 'img': img_cuckoo_flap_01,
  84.                 'snd': None,
  85.                 'dx': 0,
  86.                 'dy': -3,
  87.                 'timeout': 0 },
  88.             {
  89.                 'img': img_cuckoo_flap_01,
  90.                 'snd': None,
  91.                 'dx': 0,
  92.                 'dy': 0,
  93.                 'timeout': 0 },
  94.             {
  95.                 'img': img_cuckoo_flap_01,
  96.                 'snd': None,
  97.                 'dx': 0,
  98.                 'dy': 0,
  99.                 'timeout': 0 },
  100.             {
  101.                 'img': img_cuckoo_flap_01,
  102.                 'snd': None,
  103.                 'dx': 0,
  104.                 'dy': 0,
  105.                 'timeout': 0 },
  106.             {
  107.                 'img': img_cuckoo_flap_02,
  108.                 'snd': None,
  109.                 'dx': 0,
  110.                 'dy': 3,
  111.                 'timeout': 0 },
  112.             {
  113.                 'img': img_cuckoo_flap_02,
  114.                 'snd': None,
  115.                 'dx': 0,
  116.                 'dy': 0,
  117.                 'timeout': 0 },
  118.             {
  119.                 'img': img_cuckoo_flap_02,
  120.                 'snd': None,
  121.                 'dx': 0,
  122.                 'dy': 0,
  123.                 'timeout': 0 },
  124.             {
  125.                 'img': img_cuckoo_flap_02,
  126.                 'snd': None,
  127.                 'dx': 0,
  128.                 'dy': 0,
  129.                 'timeout': 0 }]
  130.         img_cuckoo_skate_left = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_skate_left.gif'))
  131.         img_cuckoo_stand = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_stand.gif'))
  132.         img_cuckoo_skate_right = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_skate_right.gif'))
  133.         img_cuckoo_stand_back = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_stand_back.gif'))
  134.         cuckoo_spin_left = [
  135.             {
  136.                 'img': img_cuckoo_skate_left,
  137.                 'snd': None,
  138.                 'dx': 0,
  139.                 'dy': 0,
  140.                 'timeout': 0 },
  141.             {
  142.                 'img': img_cuckoo_stand,
  143.                 'snd': None,
  144.                 'dx': 0,
  145.                 'dy': 0,
  146.                 'timeout': 0 },
  147.             {
  148.                 'img': img_cuckoo_stand,
  149.                 'snd': None,
  150.                 'dx': 0,
  151.                 'dy': 0,
  152.                 'timeout': 0 },
  153.             {
  154.                 'img': img_cuckoo_skate_right,
  155.                 'snd': None,
  156.                 'dx': 0,
  157.                 'dy': 0,
  158.                 'timeout': 0 },
  159.             {
  160.                 'img': img_cuckoo_skate_right,
  161.                 'snd': None,
  162.                 'dx': 0,
  163.                 'dy': 0,
  164.                 'timeout': 0 },
  165.             {
  166.                 'img': img_cuckoo_stand_back,
  167.                 'snd': None,
  168.                 'dx': 0,
  169.                 'dy': 0,
  170.                 'timeout': 0 },
  171.             {
  172.                 'img': img_cuckoo_stand_back,
  173.                 'snd': None,
  174.                 'dx': 0,
  175.                 'dy': 0,
  176.                 'timeout': 0 },
  177.             {
  178.                 'img': img_cuckoo_skate_left,
  179.                 'snd': None,
  180.                 'dx': 0,
  181.                 'dy': 0,
  182.                 'timeout': 0 }]
  183.         cuckoo_spin_right = [
  184.             {
  185.                 'img': img_cuckoo_skate_left,
  186.                 'snd': None,
  187.                 'dx': 0,
  188.                 'dy': 0,
  189.                 'timeout': 0 },
  190.             {
  191.                 'img': img_cuckoo_stand_back,
  192.                 'snd': None,
  193.                 'dx': 0,
  194.                 'dy': 0,
  195.                 'timeout': 0 },
  196.             {
  197.                 'img': img_cuckoo_stand_back,
  198.                 'snd': None,
  199.                 'dx': 0,
  200.                 'dy': 0,
  201.                 'timeout': 0 },
  202.             {
  203.                 'img': img_cuckoo_skate_right,
  204.                 'snd': None,
  205.                 'dx': 0,
  206.                 'dy': 0,
  207.                 'timeout': 0 },
  208.             {
  209.                 'img': img_cuckoo_skate_right,
  210.                 'snd': None,
  211.                 'dx': 0,
  212.                 'dy': 0,
  213.                 'timeout': 0 },
  214.             {
  215.                 'img': img_cuckoo_stand,
  216.                 'snd': None,
  217.                 'dx': 0,
  218.                 'dy': 0,
  219.                 'timeout': 0 },
  220.             {
  221.                 'img': img_cuckoo_stand,
  222.                 'snd': None,
  223.                 'dx': 0,
  224.                 'dy': 0,
  225.                 'timeout': 0 },
  226.             {
  227.                 'img': img_cuckoo_skate_left,
  228.                 'snd': None,
  229.                 'dx': 0,
  230.                 'dy': 0,
  231.                 'timeout': 0 }]
  232.         img_cuckoo_bow = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_bow_02.gif'))
  233.         cuckoo_bow = [
  234.             {
  235.                 'img': img_cuckoo_stand,
  236.                 'snd': None,
  237.                 'dx': 0,
  238.                 'dy': 0,
  239.                 'timeout': 0 },
  240.             {
  241.                 'img': img_cuckoo_stand,
  242.                 'snd': None,
  243.                 'dx': 0,
  244.                 'dy': 0,
  245.                 'timeout': 0 },
  246.             {
  247.                 'img': img_cuckoo_bow,
  248.                 'snd': None,
  249.                 'dx': 0,
  250.                 'dy': 0,
  251.                 'timeout': 0 },
  252.             {
  253.                 'img': img_cuckoo_bow,
  254.                 'snd': None,
  255.                 'dx': 0,
  256.                 'dy': 0,
  257.                 'timeout': 0 },
  258.             {
  259.                 'img': img_cuckoo_bow,
  260.                 'snd': None,
  261.                 'dx': 0,
  262.                 'dy': 0,
  263.                 'timeout': 0 },
  264.             {
  265.                 'img': img_cuckoo_bow,
  266.                 'snd': None,
  267.                 'dx': 0,
  268.                 'dy': 0,
  269.                 'timeout': 0 },
  270.             {
  271.                 'img': img_cuckoo_bow,
  272.                 'snd': None,
  273.                 'dx': 0,
  274.                 'dy': 0,
  275.                 'timeout': 0 },
  276.             {
  277.                 'img': img_cuckoo_bow,
  278.                 'snd': None,
  279.                 'dx': 0,
  280.                 'dy': 0,
  281.                 'timeout': 0 },
  282.             {
  283.                 'img': img_cuckoo_bow,
  284.                 'snd': None,
  285.                 'dx': 0,
  286.                 'dy': 0,
  287.                 'timeout': 0 },
  288.             {
  289.                 'img': img_cuckoo_bow,
  290.                 'snd': None,
  291.                 'dx': 0,
  292.                 'dy': 0,
  293.                 'timeout': 0 },
  294.             {
  295.                 'img': img_cuckoo_bow,
  296.                 'snd': None,
  297.                 'dx': 0,
  298.                 'dy': 0,
  299.                 'timeout': 0 },
  300.             {
  301.                 'img': img_cuckoo_bow,
  302.                 'snd': None,
  303.                 'dx': 0,
  304.                 'dy': 0,
  305.                 'timeout': 0 },
  306.             {
  307.                 'img': img_cuckoo_bow,
  308.                 'snd': None,
  309.                 'dx': 0,
  310.                 'dy': 0,
  311.                 'timeout': 0 },
  312.             {
  313.                 'img': img_cuckoo_stand,
  314.                 'snd': None,
  315.                 'dx': 0,
  316.                 'dy': 0,
  317.                 'timeout': 0 },
  318.             {
  319.                 'img': img_cuckoo_stand,
  320.                 'snd': None,
  321.                 'dx': 0,
  322.                 'dy': 0,
  323.                 'timeout': 0 }]
  324.         img_cuckoo_hula_00 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_hula_00.gif'))
  325.         img_cuckoo_hula_01 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_hula_01.gif'))
  326.         img_cuckoo_hula_02 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_hula_02.gif'))
  327.         cuckoo_hula_01 = [
  328.             {
  329.                 'img': img_cuckoo_hula_00,
  330.                 'snd': None,
  331.                 'dx': 0,
  332.                 'dy': 0,
  333.                 'timeout': 0 },
  334.             {
  335.                 'img': img_cuckoo_hula_00,
  336.                 'snd': None,
  337.                 'dx': 0,
  338.                 'dy': 0,
  339.                 'timeout': 0 },
  340.             {
  341.                 'img': img_cuckoo_hula_00,
  342.                 'snd': None,
  343.                 'dx': 0,
  344.                 'dy': 0,
  345.                 'timeout': 0 },
  346.             {
  347.                 'img': img_cuckoo_hula_01,
  348.                 'snd': None,
  349.                 'dx': 0,
  350.                 'dy': 0,
  351.                 'timeout': 0 },
  352.             {
  353.                 'img': img_cuckoo_hula_01,
  354.                 'snd': None,
  355.                 'dx': 0,
  356.                 'dy': 0,
  357.                 'timeout': 0 },
  358.             {
  359.                 'img': img_cuckoo_hula_01,
  360.                 'snd': None,
  361.                 'dx': 0,
  362.                 'dy': 0,
  363.                 'timeout': 0 },
  364.             {
  365.                 'img': img_cuckoo_hula_00,
  366.                 'snd': None,
  367.                 'dx': 0,
  368.                 'dy': 0,
  369.                 'timeout': 0 },
  370.             {
  371.                 'img': img_cuckoo_hula_00,
  372.                 'snd': None,
  373.                 'dx': 0,
  374.                 'dy': 0,
  375.                 'timeout': 0 },
  376.             {
  377.                 'img': img_cuckoo_hula_00,
  378.                 'snd': None,
  379.                 'dx': 0,
  380.                 'dy': 0,
  381.                 'timeout': 0 },
  382.             {
  383.                 'img': img_cuckoo_hula_02,
  384.                 'snd': None,
  385.                 'dx': 0,
  386.                 'dy': 0,
  387.                 'timeout': 0 },
  388.             {
  389.                 'img': img_cuckoo_hula_02,
  390.                 'snd': None,
  391.                 'dx': 0,
  392.                 'dy': 0,
  393.                 'timeout': 0 },
  394.             {
  395.                 'img': img_cuckoo_hula_02,
  396.                 'snd': None,
  397.                 'dx': 0,
  398.                 'dy': 0,
  399.                 'timeout': 0 }]
  400.         cuckoo_hula_02 = [
  401.             {
  402.                 'img': img_cuckoo_hula_00,
  403.                 'snd': None,
  404.                 'dx': 0,
  405.                 'dy': 0,
  406.                 'timeout': 0 },
  407.             {
  408.                 'img': img_cuckoo_hula_00,
  409.                 'snd': None,
  410.                 'dx': 0,
  411.                 'dy': 0,
  412.                 'timeout': 0 },
  413.             {
  414.                 'img': img_cuckoo_hula_02,
  415.                 'snd': None,
  416.                 'dx': 0,
  417.                 'dy': 0,
  418.                 'timeout': 0 },
  419.             {
  420.                 'img': img_cuckoo_hula_02,
  421.                 'snd': None,
  422.                 'dx': 0,
  423.                 'dy': 0,
  424.                 'timeout': 0 },
  425.             {
  426.                 'img': img_cuckoo_hula_00,
  427.                 'snd': None,
  428.                 'dx': 0,
  429.                 'dy': 0,
  430.                 'timeout': 0 },
  431.             {
  432.                 'img': img_cuckoo_hula_00,
  433.                 'snd': None,
  434.                 'dx': 0,
  435.                 'dy': 0,
  436.                 'timeout': 0 },
  437.             {
  438.                 'img': img_cuckoo_hula_00,
  439.                 'snd': None,
  440.                 'dx': 0,
  441.                 'dy': 0,
  442.                 'timeout': 0 },
  443.             {
  444.                 'img': img_cuckoo_hula_01,
  445.                 'snd': None,
  446.                 'dx': 0,
  447.                 'dy': 0,
  448.                 'timeout': 0 },
  449.             {
  450.                 'img': img_cuckoo_hula_01,
  451.                 'snd': None,
  452.                 'dx': 0,
  453.                 'dy': 0,
  454.                 'timeout': 0 },
  455.             {
  456.                 'img': img_cuckoo_hula_01,
  457.                 'snd': None,
  458.                 'dx': 0,
  459.                 'dy': 0,
  460.                 'timeout': 0 },
  461.             {
  462.                 'img': img_cuckoo_hula_01,
  463.                 'snd': None,
  464.                 'dx': 0,
  465.                 'dy': 0,
  466.                 'timeout': 0 }]
  467.         img_cuckoo_bend_00 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_bend_00.gif'))
  468.         img_cuckoo_bend_01 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_bend_01.gif'))
  469.         img_cuckoo_bend_02 = pygame.image.load(os.path.join(sitepkgdir, './asymptopia/anim_images/cuckoo_bend_02.gif'))
  470.         cuckoo_bend_01 = [
  471.             {
  472.                 'img': img_cuckoo_bend_00,
  473.                 'snd': None,
  474.                 'dx': 0,
  475.                 'dy': 0,
  476.                 'timeout': 0 },
  477.             {
  478.                 'img': img_cuckoo_bend_00,
  479.                 'snd': None,
  480.                 'dx': 0,
  481.                 'dy': 0,
  482.                 'timeout': 0 },
  483.             {
  484.                 'img': img_cuckoo_bend_00,
  485.                 'snd': None,
  486.                 'dx': 0,
  487.                 'dy': 0,
  488.                 'timeout': 0 },
  489.             {
  490.                 'img': img_cuckoo_bend_02,
  491.                 'snd': None,
  492.                 'dx': 0,
  493.                 'dy': 0,
  494.                 'timeout': 0 },
  495.             {
  496.                 'img': img_cuckoo_bend_02,
  497.                 'snd': None,
  498.                 'dx': 0,
  499.                 'dy': 0,
  500.                 'timeout': 0 },
  501.             {
  502.                 'img': img_cuckoo_bend_02,
  503.                 'snd': None,
  504.                 'dx': 0,
  505.                 'dy': 0,
  506.                 'timeout': 0 },
  507.             {
  508.                 'img': img_cuckoo_bend_00,
  509.                 'snd': None,
  510.                 'dx': 0,
  511.                 'dy': 0,
  512.                 'timeout': 0 },
  513.             {
  514.                 'img': img_cuckoo_bend_00,
  515.                 'snd': None,
  516.                 'dx': 0,
  517.                 'dy': 0,
  518.                 'timeout': 0 },
  519.             {
  520.                 'img': img_cuckoo_bend_00,
  521.                 'snd': None,
  522.                 'dx': 0,
  523.                 'dy': 0,
  524.                 'timeout': 0 },
  525.             {
  526.                 'img': img_cuckoo_bend_01,
  527.                 'snd': None,
  528.                 'dx': 0,
  529.                 'dy': 0,
  530.                 'timeout': 0 },
  531.             {
  532.                 'img': img_cuckoo_bend_01,
  533.                 'snd': None,
  534.                 'dx': 0,
  535.                 'dy': 0,
  536.                 'timeout': 0 },
  537.             {
  538.                 'img': img_cuckoo_bend_01,
  539.                 'snd': None,
  540.                 'dx': 0,
  541.                 'dy': 0,
  542.                 'timeout': 0 }]
  543.         cuckoo_bend_02 = [
  544.             {
  545.                 'img': img_cuckoo_bend_00,
  546.                 'snd': None,
  547.                 'dx': 0,
  548.                 'dy': 0,
  549.                 'timeout': 0 },
  550.             {
  551.                 'img': img_cuckoo_bend_00,
  552.                 'snd': None,
  553.                 'dx': 0,
  554.                 'dy': 0,
  555.                 'timeout': 0 },
  556.             {
  557.                 'img': img_cuckoo_bend_00,
  558.                 'snd': None,
  559.                 'dx': 0,
  560.                 'dy': 0,
  561.                 'timeout': 0 },
  562.             {
  563.                 'img': img_cuckoo_bend_01,
  564.                 'snd': None,
  565.                 'dx': 0,
  566.                 'dy': 0,
  567.                 'timeout': 0 },
  568.             {
  569.                 'img': img_cuckoo_bend_01,
  570.                 'snd': None,
  571.                 'dx': 0,
  572.                 'dy': 0,
  573.                 'timeout': 0 },
  574.             {
  575.                 'img': img_cuckoo_bend_01,
  576.                 'snd': None,
  577.                 'dx': 0,
  578.                 'dy': 0,
  579.                 'timeout': 0 },
  580.             {
  581.                 'img': img_cuckoo_bend_01,
  582.                 'snd': None,
  583.                 'dx': 0,
  584.                 'dy': 0,
  585.                 'timeout': 0 },
  586.             {
  587.                 'img': img_cuckoo_bend_00,
  588.                 'snd': None,
  589.                 'dx': 0,
  590.                 'dy': 0,
  591.                 'timeout': 0 },
  592.             {
  593.                 'img': img_cuckoo_bend_00,
  594.                 'snd': None,
  595.                 'dx': 0,
  596.                 'dy': 0,
  597.                 'timeout': 0 },
  598.             {
  599.                 'img': img_cuckoo_bend_02,
  600.                 'snd': None,
  601.                 'dx': 0,
  602.                 'dy': 0,
  603.                 'timeout': 0 },
  604.             {
  605.                 'img': img_cuckoo_bend_02,
  606.                 'snd': None,
  607.                 'dx': 0,
  608.                 'dy': 0,
  609.                 'timeout': 0 }]
  610.         self.sequences = {
  611.             'cuckoo_flap': cuckoo_flap,
  612.             'cuckoo_spin_left': cuckoo_spin_left,
  613.             'cuckoo_spin_right': cuckoo_spin_right,
  614.             'cuckoo_bow': cuckoo_bow,
  615.             'cuckoo_hula_01': cuckoo_hula_01,
  616.             'cuckoo_hula_02': cuckoo_hula_02,
  617.             'cuckoo_bend_01': cuckoo_bend_01,
  618.             'cuckoo_bend_02': cuckoo_bend_02 }
  619.         self.defineManeuver('cuckoo_maneuver_00', [
  620.             {
  621.                 'cuckoo_flap': (-999, 10) }])
  622.         self.defineManeuver('cuckoo_maneuver_01', [
  623.             {
  624.                 'cuckoo_spin_left': (-999, 10) }])
  625.         self.defineManeuver('cuckoo_maneuver_01', [
  626.             {
  627.                 'cuckoo_spin_right': (-999, 10) }])
  628.         self.defineManeuver('cuckoo_maneuver_02', [
  629.             {
  630.                 'cuckoo_bow': (-999, 10) }])
  631.         self.defineManeuver('cuckoo_maneuver_04', [
  632.             {
  633.                 'cuckoo_hula_01': (-999, 10) }])
  634.         self.defineManeuver('cuckoo_maneuver_05', [
  635.             {
  636.                 'cuckoo_hula_02': (-999, 10) }])
  637.         self.defineManeuver('cuckoo_maneuver_06', [
  638.             {
  639.                 'cuckoo_bend_01': (-999, 10) }])
  640.         self.defineManeuver('cuckoo_maneuver_07', [
  641.             {
  642.                 'cuckoo_bend_02': (-999, 10) }])
  643.  
  644.     
  645.     def defineManeuver(self, maneuver_name, seqlist):
  646.         self.maneuvers[maneuver_name] = seqlist
  647.  
  648.     
  649.     def getSequencesPyld(self):
  650.         return self.sequences
  651.  
  652.     
  653.     def getManeuversPyld(self):
  654.         return self.maneuvers
  655.  
  656.     
  657.     def getManeuverNames(self):
  658.         maneuver_names = []
  659.         for key in self.maneuvers.keys():
  660.             maneuver_names.append(key)
  661.         
  662.         return maneuver_names
  663.  
  664.  
  665.